<template>
	<view>
		<u-cell-group v-if='true'>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动标题" :value="details.title"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动参与人数限制" :value="details.maxPerson==0?'不限制':details.maxPerson"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动申请人" :value="details.applyName"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动申请人联系方式" :value="details.applyPhone"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="主办单位" :value="details.hostunit"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动联系人姓名" :value="details.phone"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动联系人联系方式" :value="details.linkman"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动报名时间" :value="details.applyStartTime+'-'+details.applyEndTime"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动报名城市" :value="details.address"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动详细地址" :value="details.addressDetail"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动主图">

				<u-image @click='handBigImg(details.titleImg)' slot="label" border-radius='8' :fade="true" duration="450" width="690rpx"
				 height="346rpx" :src="details.titleImg"></u-image>
			</u-cell-item>
			<u-cell-item @click='handBrief' :value-style='valueStyle' :title-style='titleStyle' :arrow='true' title="活动简介"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动报名费用设置" :value="details.offlinePay?'允许线下缴费':'不允许线下缴费'"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动时间" :value="details.startTime+'-'+details.endTime"></u-cell-item>
			<u-cell-item @click='handGuest' :value-style='valueStyle' :title-style='titleStyle' :arrow='true' title="活动嘉宾"></u-cell-item>
			<u-cell-item @click='handHotelInfo' :value-style='valueStyle' :title-style='titleStyle' :arrow='true' title="酒店信息发布"></u-cell-item>
			</u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="活动报名信息管理" value="购票人姓名"></u-cell-item>

		</u-cell-group>
		<view>
			<u-modal width='90%' v-model="show" :title='modelTile'>
				<scroll-view scroll-y="true">
					<view class="modal-box" v-if="modelType">
						<u-parse :html="content"></u-parse>
					</view>
					<view class="modal-box" v-else>
						<view class="guestItem" v-if="activityGuestList.length!=0">
							<view class="item" v-for="(item,index) in activityGuestList">
								<u-image @click='handBigImg(item.guestImg,index)' border-radius='8' :fade="true" duration="450" width="172rpx"
								 height="230rpx" :src="item.guestImg"></u-image>
								<view class="person-msg">
									<view class="title-text">
										{{item.guestName}}
									</view>
									<view class="post">
										{{item.guestType}}
									</view>
									<view class="content-text cont">
										{{item.guestText}}
									</view>
								</view>
							</view>
						</view>
						<view v-else class="content-text" style="width: 100%;text-align: center;">
							暂无特邀嘉宾
						</view>
					</view>
				</scroll-view>
			</u-modal>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			details: {
				type: Object,
				default: () => {}
			},
			activityGuestList: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {
				modelType: true,
				modelTile: '详情',
				show: false,
				titleStyle: {
					fontWeight: "bold",
					color: '#303030',
					fontSize: '28rpx'
				},
				valueStyle: {
					color: '#666666',
					fontSize: '32rpx'
				},
				content: ''
			};
		},
		methods: {
			handBigImg(imgUrl, index) {
				uni.previewImage({
					current: index,
					urls: [imgUrl]
				})
			},
			//活动嘉宾
			handGuest() {
				this.modelType = false
				this.modelTile = '活动嘉宾'
				this.content = this.details.introduction || '<view style="width: 100%;text-align: center;">暂无活动嘉宾</view>'
				this.show = true
			},
			//简介
			handBrief() {
				this.modelType = true
				this.modelTile = '活动简介'
				this.content = this.details.introduction || '<view style="width: 100%;text-align: center;">暂无活动简介</view>'
				this.show = true
			},
			handHotelInfo() {
				this.modelType = true
				this.modelTile = '酒店信息发布'
				this.content = this.details.hotelInfo || '<view style="width: 100%;text-align: center;">暂无酒店信息发布</view>'
				this.show = true
			},
			handBigImg(imgUrl) {
				uni.previewImage({
					current: 0,
					urls: [imgUrl]
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.guestItem {
		.item {
			padding: 40rpx 30rpx;
			@include my-flex($fw: nowrap);
			background-color: $bs-text-color-fff;
			border-radius: $bs-border-radius-12;
			margin-bottom: 30rpx;
			background-color: #f7f7f7;

			.person-msg {
				margin-left: 40rpx;

				@include my-flex($fd: column, $jc:$bs-sb) .post {
					font-size: 24rpx;
					color: $bs-text-color-999;
				}

				.cont {
					@include ellipsisMultiline(3)
				}
			}
		}
	}

	.modal-box {
		max-height: 1000rpx;
		padding: 30rpx;
	}
</style>
